1. Field of the Invention
The present invention relates to a printing apparatus for printing according to data sent from a host device, to a control method for a printing apparatus, a program by which such a method is specified, and a printing system including a printing apparatus and a host device.
2. Description of the Related Art
When the paper runs out, a cover is opened, a paper jam occurs, or other problem that renders the printer unable to print occurs, in a printer that is used connected to a host device, printers conventionally run an error recovery process such as outlined below and taught in JP-A-2005-7762 (U.S. Pat. No. 6,910,817) to recover from the problem.
(1) When a problem occurs, the printer sends an error status report to the host device and processes the unprinted data according to a predetermined processing mode. The selectable processing modes are as follows:                (a) The content of the receive buffer and the print buffer is saved and the normal processing mode is continued without going to a deletion processing mode.        (b) The content of the receive buffer and the printer buffer is discarded and a deletion processing mode is entered.        
(2) When the host device that is monitoring the status of the printer receives the error status report from the printer, it interrupts data transmission.
(3) When the printer confirms that the cause of the error or problem has been resolved, it sends an error recovery status report to the host device and returns to the normal processing mode. If unprocessed data remains in the receive buffer as noted in (a) above, the unprocessed data is processed.
(4) When the host device receives the error recovery status report from the printer, it executes a data transmission process based on the selected processing mode. If processing mode (a) above is selected, data transmission resumes from the unsent data following the previously transmitted data. If processing mode (b) above is selected, the unsent data is discarded and all data is resent from the beginning of the previously transmitted data.
There are, however, many different factors that can create an error, and the appropriate processing mode may differ according to the cause of the error. The prior art described above specifies a common processing mode for all causes of errors, but the specified processing mode is not necessarily appropriate to all causes of errors.
For example, if the cause of the error is that the supply of roll paper ran out, the already printed portion and the portion printed to the new roll paper will be printed on separate pieces of paper if processing mode (a) above is used. Processing mode (b) is therefore preferable in this case so that all data is reprinted from the beginning on the new roll of paper. Once a new roll of paper is loaded and the error is cancelled, data transmission from the host will resume from the unprocessed data continuing from the data that was transmitted before the paper ran out if processing mode (a) is selected. The printer will thus print the data remaining in the receive buffer and the print buffer as well as the previously untransmitted data sent from the host after operation resumes. The printout will therefore be split between the paper that was printed before the paper ran out and the new supply of paper. Printing must be repeated from the beginning in this case if a printout on a single sheet of paper is desired.
Furthermore, if the cause of the error is an open cover and the printer is designed to automatically resume normal operation when the cover is closed, it is preferably to continue printing the unprinted data following the already printed data by executing processing mode (a) above. If processing mode (b) is selected in this case, data transmission from the host resumes when the cover is closed and the open cover error is cancelled, the untransmitted data is discarded, and all data is resent from the beginning of the previously transmitted data. The printer then prints all of the data sent from the host after operation resumes. Thus, the previously transmitted data will be printed a second time even though printing all data has already been completed if the untransmitted data is sent following the previously sent data.
Executing an inappropriate processing mode thus wastes processing time and consumables such as paper and ink.